package xyz.weizhi;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.mybatis.spring.SqlSessionTemplate;
import xyz.weizhi.mapper.UserMapper;
import xyz.weizhi.pojo.User;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * @Author milian
 * @Date 2021/9/6 0006 8:44
 */
public class UserMapperImp implements UserMapper {
    private SqlSessionTemplate sqlSession;
    public void setSqlSession(SqlSessionTemplate sqlSession){
        this.sqlSession = sqlSession;
    }
    @Override
    public List<User> selectAll()  {

        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        List<User> users = null;
        users = mapper.selectAll();
        return users;
    }
}
